package org.ymjava.medical.wx.web;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.ymjava.medical.core.util.ResponseUtil;
import org.ymjava.medical.db.AllPackage.biz.NurseDeptBiz;
import org.ymjava.medical.db.AllPackage.biz.NurseJobBiz;
import org.ymjava.medical.db.AllPackage.biz.NurseMechanismBiz;
import org.ymjava.medical.db.AllPackage.entity.NurseDept;
import org.ymjava.medical.db.AllPackage.entity.NurseJob;
import org.ymjava.medical.db.AllPackage.entity.NurseMechanism;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("wx_answer/information")
public class InformationController {


    @Autowired
    NurseDeptBiz deptBiz;

    @Autowired
    NurseMechanismBiz mechanismBiz;

    @Autowired
    NurseJobBiz jobBiz;

    @GetMapping("/list")
    public Object list(){

        Map<String,Object> data = new HashMap<>(3);

        List<NurseDept> deptList = deptBiz.list_sort();

        List<NurseMechanism> mechanismList = mechanismBiz.list_sort();

        List<NurseJob> jobList = jobBiz.list_sort();


        data.put("deptList",deptList);

        data.put("mechanismList",mechanismList);

        data.put("jobList",jobList);


        return ResponseUtil.ok(data);
    }

}
